﻿using System;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;

namespace MG1
{

    public static class G
    {
        public static GraphicsDeviceManager graph;
        public static DrawableGameComponent draw;
        public static GameComponentCollection comp;
        private static Game game;
        public static SpriteBatch spriteBatch;
        public static InputManager input;
        public static ScreenManager screenManager; 

        public static Serializer ConfigSerializer = new Serializer();
        public static ConfigSection Config;
        public static Settings Setting;
        
        public static Game Game
        {
            get { return G.game; }
            //set { GlobalVar.game = value; }
        }

        public static void SetUP(Game g)
        {
            game = g;
            graph = new GraphicsDeviceManager(game);
            draw = new DrawableGameComponent(game);
            comp = game.Components;

            ConfigSerializer.LoadConfig();
            Config = new ConfigSection(ConfigSerializer.config);
            Setting = new Settings();
            input = new InputManager();

            screenManager = new ScreenManager(g);
            g.Components.Add(screenManager);
            screenManager.AddScreen(new GameplayScreen(), null);
        }


    }

}
